<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        body {
            background: url(../image/1.jpg) no-repeat;
            height:100%;
            width:100%;
            background-size: cover; 
        }

        .top {
            height: 150px;
            background-color: rgba(241, 232, 232, 0.5);
            display: flex;
            justify-content: center;
        }

        .top img {
            width: 200px;
            height: 124px;
            margin-left: 20px;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div class="top" id="top">
            <img src="../image/1.jpg" alt="">
            <img src="../image/2.jpg" alt="">
            <img src="../image/3.jpg" alt="">
        </div>
    </div>

    <script>
        var topObj = document.getElementById('top')
        var imgObj = topObj.children


        for (var i = 0; i < imgObj.length; i++) {
            imgObj[i].onclick = function () {
                // var a = this.src
                // console.log(a)
                document.getElementsByTagName("body")[0].style.background = "url("+this.src+")"
            }
        }
    </script>
</body>

</html>